package com.reading.controller;

import com.reading.pojo.SignIn;
import com.reading.service.SignInService;
import com.reading.vo.SignVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("sign")
public class SignInController {

    @Autowired
    private SignInService signInService;

    @RequestMapping("/findContinuous")
    public Integer findContinuous(Integer userId){
       return signInService.findContinuous(userId);
    }

    @RequestMapping("/findPrevious")
    public SignIn findPrevious(@RequestBody SignVo signVo){
       return signInService.findPrevious(signVo);
    }

    @RequestMapping("/findLastData")
    public SignIn findLastData(Integer userId){
       return signInService.findLastData(userId);
    }

    @RequestMapping("/toSignIn")
    public String toSignIn(Integer userId){
        return signInService.toSignIn(userId);
    }

    @RequestMapping("/findTodayData")
    public SignIn findTodayData(@RequestBody SignVo signVo){
        return signInService.findTodayData(signVo);
    }
}
